#ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include "header.h"


typedef struct list_node
{
    fdesc *data;
    void *key;
    struct list_node *next;
} l_node;




/*---------------function declaration---of linked list-------------*/

/* returns void *data correspondign to the node that matches the given key */
l_node *list_search_strkey( l_node *head, char *key );

l_node *list_search_prefix(l_node *head, char *key );

/*insert element in the linked list*/
l_node *list_insert_start( l_node *head, void *key, fdesc* data);

/*insertion at the end*/
l_node *list_insert_end( l_node *head,void *key,fdesc *data);

/*delete a node*/
l_node *list_delete_node(l_node *head, fdesc* fd);

/*display list*/
void print_list(l_node* head);


l_node *list_insert(l_node *head,void *data);





#endif // LINKEDLIST_H_INCLUDED
